<template>
	<view class="avatar-content">
		<tn-avatar v-if="img" size="lg" shape="circle" :src="avatarUrl"></tn-avatar>
		<tn-avatar v-else size="lg" shape="circle" src="https://img1.baidu.com/it/u=946811137,302769443&fm=253&app=138&size=w931&n=0&f=JPEG&fmt=auto?sec=1669309200&t=f41038b274ad95001481ff67599c99e2"></tn-avatar>
		<view class="nick-name tn-flex-1">
			<view>
				<text class="nick">{{name}}</text>
				<tn-tag v-if="tags" backgroundColor="#9DD757" fontColor="#fff" :fontSize="20" height="40rpx" shape="circle">{{tags}}</tn-tag>
			</view>
			<view class="time">{{time}}</view>
		</view>
		<view class="right-content">
			<slot name="right"></slot>
		</view>
	</view>
</template>

<script>
	export default{
		props:{
			img:{
				type:String,
				default:''
			},
			name:{
				type: String,
				default:''
			},
			tags:{
				type:String,
				default:''
			},
			time:{
				type:String,
				default:''
			}
		},
		computed:{
			avatarUrl(){
				const imageTitle = this.config.apiUri + '/sysFileInfo/previewImg?id=';
				return imageTitle+this.img
			}
		},
		data(){
			return{
				
			}
		}
	}
</script>

<style lang="less" scoped>
	.avatar-content{
		display: flex;
		align-items: center;
		
		.nick-name{
			margin-left: 12rpx;
			
			.nick{
				color: #000;
				font-size: 30rpx;
				line-height: 52rpx;
				vertical-align: middle;
				margin-right: 6rpx;
			}
			.time{
				line-height: 52rpx;
				font-size: 20rpx;
				color:#666666;
			}
		}
	}
</style>